function arrayAdd(arr) {
    return arr.toString().split(',').reduce((total, item) => total += Number(item), 0);
};

const arr = [1, 2, 3, [[4, 5], 6], 7, 8, 9];

console.log(arrayAdd(arr));  // 45


console.log([1,2,3, [4,5]].toString());   // 1,2,3,4,5